# 猜单词游戏
import random

WORDS = ("python", "jumble", "easy", "difficult", "answer", "continue", "phone", "position", "pose", "game")

print(
    """
       欢迎参加猜单词游戏
   把字母组合成一个正确的单词吧！     
"""
)
isContinue = "y"
while isContinue == "y" or isContinue == "Y":
    word = random.choice(WORDS)
    correct = word
    jumble = ""
    while word:
        position = random.randrange(len(word))
        jumble += word[position]
        word = word[:position] + word[(position + 1):]
    print("乱序后单词：", jumble)

    guess = input("\n请你猜：")
    while guess != correct and guess != "":
        print("对不起不正确.")
        guess = input("继续猜：")
    if guess == correct:
        print("你真棒，猜对啦！")
    isContinue = input("\n是否继续(Y/N):")
